import styled from 'styled-components'
import border from '@/assets/styled/border'

const CategoryWrap = styled.div `
  height: 100%;
  display: flex;
  flex-direction: column;
  nav {
    display: flex;
    justify-content: center;
    align-items: center;
    height: .44rem;
    background: #ee742f;
  }
  .menu {
    flex: 1;
    position: relative;
    overflow: hidden;
  }
`

const NavList = border(
  styled.ul `
    height: 100%;
    display: flex;
    width: 1.4rem;
    height: .3rem;
    position: relative;
    overflow: scroll;
    li {
      flex: 1;
      width: .7rem;
      text-align: center;
      line-height: .3rem;
      z-index: 1001;
      color: #fff;
      &.active {
        color: #ee742f;
      }
      &:last-child {
        height: .3rem;
        position: absolute;
        top: 0;
        left: 0;
        background-color: #fff;
        z-index: 1000;
        border-radius: .15rem;
        &.right {
          left: .7rem;
        }
        transition: left 200ms ease-in
      }
    }
  `
)

const ClassifyWray = border(
  styled.div `
    flex: 1;
    display: flex;
    overflow: hidden;
    > ul:first-child {
      flex: 90;
      overflow-y: scroll;
      li {
        height: .5rem;
        line-height: .5rem;
        text-align: center;
        &.active {
          background-color: #fff;
          color: #ee742f;
          position: relative;
          span {
            display: inline-block;
            height: 100%;
            border-bottom: solid 2px #ee742f;
          }
        }
      }
    }
    > ul:last-child {
      flex: 285;
      background-color: #fff;
      display: flex;
      flex-wrap: wrap;
      align-content: flex-start;
      padding: .1rem 0;
      overflow-y: scroll;
      li {
        width: 33.333333%;
        line-height: .5rem;
        text-align: center;
      }
    }
  `
)

export {
  CategoryWrap,
  NavList,
  ClassifyWray
}